/*
 * This file is curently planned for removal, as the blocks system is being replaced with RFID tags
 */

#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>

#include "block.hpp"

Block::Block() {
	ID = 0;
	name = "default";
	links.clear();

}

Block::Block(const Block& a) {
	ID = a.ID;
	name = a.name;
	links = a.links;
}

int Block::getID() {
	return this->ID;
}

string Block::getName() {
	return this->name;
}

Block* Block::getLink(unsigned int index) {
	if (index < links.size())
		return links[index];
	else
		return NULL;
}

void Block::printBlockInfo(vector<Block*> BlockMap) {

	for (unsigned int i = 0; i < BlockMap.size(); i++) {
		cout << "Block " << i << " has ID of: " << BlockMap.at(i)->ID << endl;
		cout << "   Name   : " << BlockMap.at(i)->name << endl;
		cout << "   Status : " << (int) BlockMap.at(i)->status << endl;
	}
}
